<!DOCTYPE html>
<html>
<head>
</head>
<body class="guibowebindex articleNews">
<div class="header">
	<div class="logo left">
	</div>
	<div class="right">
	</div>
</div>
<p><font color="#FFFFFF"></font></p>
<div class="ad">
 </div>
<div class="clear"></div>
	<div class="he5"></div>
<div class="guiboweb">
	<div class="con">
<script type="text/javascript">
!-- Begin
function run() {
with (document.agecalc) {
dd = parseInt(day.selectedIndex) + 1;
mm = parseInt(month.selectedIndex) + 1;
yy = year.value;
if (yy.length != 4 || isNaN(yy)) {
document.agecalc.timealive.value = "请输入4位数的年份.";
document.agecalc.year.select();
document.agecalc.year.focus();
return;
   }
}
days = new Date();
gdate = days.getDate();
gmonth = days.getMonth();
gyear = days.getYear();
if (gyear < 2000) gyear += 1900;
age = gyear - yy;
if ((mm == (gmonth + 1)) && (dd <= parseInt(gdate))) {
age = age; 
} else {
if (mm <= (gmonth)) {
age = age;
} else {
age = age - 1; 
   }
}
if (age == 0)
age = age;
document.agecalc.timealive.value = "你已经满了 " + age+ " 周岁\n\n";
if (mm <= (gmonth + 1))
age = age - 1;
if ((mm == (gmonth + 1)) && (dd > parseInt(gdate))) 
age = age + 1;
var m;
var n;
if (mm == 12) n = 31 - dd;
if (mm == 11) n = 61 - dd;
if (mm == 10) n = 92 - dd;
if (mm == 9) n = 122 - dd;
if (mm == 8) n = 153 - dd;
if (mm == 7) n = 184 - dd;
if (mm == 6) n = 214 - dd;
if (mm == 5) n = 245 - dd;
if (mm == 4) n = 275 - dd;
if (mm == 3) n = 306 - dd;
if (mm == 2) { n = 334 - dd; if (leapyear(yy)) n++; }
if (mm == 1) { n = 365 - dd; if (leapyear(yy)) n++; }
if (gmonth == 1) m = 31;
if (gmonth == 2) {
m = 59;
if (leapyear(gyear)) m++;
}
if (gmonth == 3)  { m = 90;  if (leapyear(gyear)) m++; }
if (gmonth == 4)  { m = 120; if (leapyear(gyear)) m++; }
if (gmonth == 5)  { m = 151; if (leapyear(gyear)) m++; }
if (gmonth == 6)  { m = 181; if (leapyear(gyear)) m++; }
if (gmonth == 7)  { m = 212; if (leapyear(gyear)) m++; }
if (gmonth == 8)  { m = 243; if (leapyear(gyear)) m++; }
if (gmonth == 9)  { m = 273; if (leapyear(gyear)) m++; }
if (gmonth == 10) { m = 304; if (leapyear(gyear)) m++; }
if (gmonth == 11) { m = 334; if (leapyear(gyear)) m++; }
if (gmonth == 12) { m = 365; if (leapyear(gyear)) m++; }
months = age * 12;
months += 12 - parseInt(mm);
months += gmonth;
totdays = (parseInt(age) * 365);
totdays += age / 4;
totdays = parseInt(totdays) + gdate + m + n;
if (gmonth == 1) p = 31 + gdate;
if (gmonth == 2) {
p = 59 + gdate;
if (leapyear(gyear)) m = m+1;
}
if (gmonth == 3)  { p = 90 + gdate;  if (leapyear(gyear)) p++; }
if (gmonth == 4)  { p = 120 + gdate; if (leapyear(gyear)) p++; }
if (gmonth == 5)  { p = 151 + gdate; if (leapyear(gyear)) p++; }
if (gmonth == 6)  { p = 181 + gdate; if (leapyear(gyear)) p++; }
if (gmonth == 7)  { p = 212 + gdate; if (leapyear(gyear)) p++; }
if (gmonth == 8)  { p = 243 + gdate; if (leapyear(gyear)) p++; }
if (gmonth == 9)  { p = 273 + gdate; if (leapyear(gyear)) p++; }
if (gmonth == 10) { p = 304 + gdate; if (leapyear(gyear)) p++; }
if (gmonth == 11) { p = 334 + gdate; if (leapyear(gyear)) p++; }
if (gmonth == 12) { p = 365 + gdate; if (leapyear(gyear)) p++; }
weeks = (age * 365) + n + p;
weeks = weeks / 7;
etcdays = parseFloat(weeks) - parseInt(weeks);
etcdays = Math.round(etcdays * 7);
weeks = parseInt(weeks);
etcdays += parseInt(age / 4);
if (etcdays > 7)
weeks += parseInt(etcdays / 7);
document.agecalc.timealive.value += "     已过了 " + months + " 月\n";
document.agecalc.timealive.value += "     已过了 " + weeks + " 周\n";
document.agecalc.timealive.value += "     已过了 " + totdays + " 天\n";
var time = new Date();
ghour = time.getHours();
gmin = time.getMinutes();
gsec = time.getSeconds(); 
hour = ((age * 365) + n + p) * 24;
hour += (parseInt(age / 4) * 24);
document.agecalc.timealive.value += "     已过了" + hour + " 小时\n";
var min = (hour * 60) + gmin;
document.agecalc.timealive.value += "     已过了 " + min + " 分钟\n";
sec = (min * 60) + gsec;
document.agecalc.timealive.value += "     已过了 " + sec + " 秒钟";
mm = mm - 1;
var r;
if (mm == 0) r = 0;
if (mm == 1) r = 31;
if (mm == 2) { r = 59; if (leapyear(gyear)) m++; }
if (mm == 3)  { r = 90;  if (leapyear(gyear)) r++; }
if (mm == 4)  { r = 120; if (leapyear(gyear)) r++; }
if (mm == 5)  { r = 151; if (leapyear(gyear)) r++; }
if (mm == 6)  { r = 181; if (leapyear(gyear)) r++; }
if (mm == 7)  { r = 212; if (leapyear(gyear)) r++; }
if (mm == 8)  { r = 243; if (leapyear(gyear)) r++; }
if (mm == 9)  { r = 273; if (leapyear(gyear)) r++; }
if (mm == 10) { r = 304; if (leapyear(gyear)) r++; }
if (mm == 11) { r = 334; if (leapyear(gyear)) r++; }
mm = mm + 1;
r = parseInt(r) + parseInt(dd);

if ((mm >= (gmonth + 1)) && (dd > gdate)) {
bday = r - m - gdate;
}
else {
if ((leapyear(gyear)) && ((mm > 2) && (dd < 29))) {
a = 366;
} else {
a = 365;
}
bday = a + (r - m - gdate);
}
nhour = 24 - parseInt(ghour);
nmin = 60 - parseInt(gmin);
nsec = 60 - parseInt(gsec);
while (bday > 366) bday -= 365;
if (((bday == 366) && (leapyear(gyear)) || ((bday == 365) && (!leapyear(gyear))))) {
document.agecalc.timealive.value += "\n\nSenlon祝贺您！今天是你的生日！祝你生日快乐！";
} else {
document.agecalc.timealive.value += "\n\n你已过了：\n"
+ age + " 年"+ months + " 月"+ totdays + " 天 " + hour + " 小时 "+ min + " 分 " + sec + " 秒";
setTimeout("run()", 1000);
   }
}
function leapyear(a) {
if (((a%4 == 0) && (a%100 != 0)) || (a%400 == 0))
return true;
else
return false;
}
//  End -->
</script>

<style>
td,p{color:000000;font-size:50px;}</style>
<body onMouseOut="window.status='(chaxun8.net)查询吧!';return true">

        <form name=agecalc>
          <tr>

            <td align=right height="177"><font color="#7F9DB9"><b>你的出生日期是:</b></font> 
                <input type=text name=year size=6 maxlength=4>
                <b><font color="#7F9DB9">年</font></b>
                <select name=month size=1>
                  <option>1月 
                  <option>2月 
                  <option>3月 
                  <option>4月 
                  <option>5月 
                  <option>6月 
                  <option>7月 
                  <option>8月 
                  <option>9月 
                  <option>10月 
                  <option>11月 
                  <option>12月                 
                </select> 
                <select name=day size=1>
                  <option>1日 
                  <option>2日 
                  <option>3日 
                  <option>4日 
                  <option>5日 
                  <option>6日 
                  <option>7日 
                  <option>8日 
                  <option>9日 
                  <option>10日 
                  <option>11日 
                  <option>12日 
                  <option>13日 
                  <option>14日 
                  <option>15日 
                  <option>16日 
                  <option>17日 
                  <option>18日 
                  <option>19日 
                  <option>20日 
                  <option>21日 
                  <option>22日 
                  <option>23日 
                  <option>24日 
                  <option>25日 
                  <option>26日 
                  <option>27日 
                  <option>28日 
                  <option>29日 
                  <option>30日 
                  <option>31日                 
                </select> 
                <input type=button name=start value="计算" onclick="run();">
                <br> 
                <br> 
                &nbsp; 
                <textarea rows=13 cols=43 name=timealive></textarea>
</td>
			  		              
          </tr><div align="center"></div>
        </form>
      </table>
</td>
    </tr>
</table>
</html>